import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Http,Response } from '@angular/http';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  list: Object;

  //接收数据用
  listData: Object;

  //依赖注入
  constructor(public navCtrl: NavController,private http: Http) {

  }

  ionViewDidLoad(){
    //网络请求
    // this.http.request('http://jsonplaceholder.typicode.com/photos')
    //   .subscribe((res:Response) =>{
    //     this.listData = res.json();
    //   });
    this.http.request('http://192.168.3.34:3000/tst/student/examination/lst/pid/1/class_id/1')
      .subscribe((res:Response)=>{
        this.list = res.json();
      });

  }
}


